package fr.umlv.rtsjtaskserver.server;

import java.util.ArrayList;
import java.util.List;

import javax.realtime.Schedulable;
import javax.realtime.Scheduler;

public abstract class TaskServer extends Scheduler implements Schedulable{
	
	private List<ServableAsyncEventHandler> tasks = new ArrayList<ServableAsyncEventHandler>();
	
	public void eventReleased(ServableAsyncEventHandler handler){
		this.tasks.add(handler);
	}
	
	protected ServableAsyncEventHandler getFollowingTask(){
		return this.tasks.remove(this.tasks.size());
	}
}
